package com.greateamd.timetableasy.server.dao;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import org.hibernate.HibernateException;
import org.springframework.security.access.prepost.PreAuthorize;

import com.greateamd.timetableasy.domain.Cursus;
import com.greateamd.timetableasy.domain.Event;
import com.greateamd.timetableasy.domain.StudyPeriod;


public interface CursusDAO extends IBaseDao<Cursus, Integer> {

	@Override @PreAuthorize("hasRole('ROLE_ADMIN')")
	void save(Cursus cursus) throws HibernateException,SQLException;
	
	@Override @PreAuthorize("hasRole('ROLE_ADMIN')")
	public void update(Cursus cursus)throws HibernateException,SQLException,IllegalAccessException;
	
	@PreAuthorize("hasAnyRole('ROLE_ADMIN','ROLE_CAMPUS_MANAGER')")
	void updateSp(StudyPeriod sp) throws HibernateException,SQLException,IllegalAccessException;

	@Override @PreAuthorize("hasRole('ROLE_ADMIN')")
	public void delete(Cursus cursus)throws HibernateException,SQLException,IllegalAccessException;
	
	List<Event> getStudyPeriodPlanning(StudyPeriod studyPeriod, Date fromDate, Date toDate);

}
